/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.qms.service.impl;

import com.opgea.qms.dao.impl.LoginDAOImpl;
import com.opgea.qms.domain.entities.Login;
import com.opgea.qms.domain.entities.LoginPK;
import com.opgea.qms.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author Ramesh
 */
@Service
public class LoginServiceImpl implements LoginService{

    
    @Autowired
    private LoginDAOImpl loginDAO;
    
    @Override
    public Boolean isAuthenticUser(String loginId, String password) {
        System.out.println("LoginDAO >> isAuthentic: "+loginId+" | "+password);
        Boolean authentic = false;
        Login login = loginDAO.find(loginId);
        if(login != null){
            if(login.getPassword().equals(password)){
                authentic = true;
            }
        }
        return authentic;
    }
    
    @Override
    public Login find(String loginId){
        return loginDAO.find(loginId);
    }
    
}
